clear
clc

%all export to U.S.
[num,txt,raw] = xlsread('offlist_and_onlist.xlsx');

off_china=num(:,2);
on_china=num(:,3);

off_city=num(:,4);
on_city=num(:,5);

time = datenum(2016,[1:((2019-2016)+1)*12].',1);
time=time(1:end-6);


%generate Figure A3 (a)
figure(1)

[hAx,hLine1,hLine2] = plotyy(time(1:end-1),log(off_china)/log(10),time(1:end-1),log(off_city)/log(10)-3);
hLine1.LineWidth =2;
hLine1.LineStyle ="--";
hLine2.LineWidth =2;
ylabel(hAx(1),'China') % left y-axis 
ylabel(hAx(2),'Our Sample City') % right y-axis
datetick(hAx(1), 'x', 'mm/dd/yyyy')
datetick(hAx(2), 'x', 'mm/dd/yyyy')
xlim(hAx(1),[time(1) time(end)])
xlim(hAx(2),[time(1) time(end)])
ylim(hAx(1),[6.9 7.4])
ylim(hAx(2),[5.4 6.0])

%generate Figure A3 (b)
figure(2)

[hAx,hLine1,hLine2] = plotyy(time(1:end-1),log(on_china)/log(10),time(1:end-1),log(on_city)/log(10)-3);
hLine1.LineWidth =2;
hLine1.LineStyle ="--";
hLine2.LineWidth =2;
ylabel(hAx(1),'China') % left y-axis 
ylabel(hAx(2),'Our Sample City') % right y-axis
datetick(hAx(1), 'x', 'mm/dd/yyyy')
datetick(hAx(2), 'x', 'mm/dd/yyyy')
xlim(hAx(1),[time(1) time(end)])
xlim(hAx(2),[time(1) time(end)])
ylim(hAx(1),[7.0 7.50])
ylim(hAx(2),[5.4 6.2])
yticks(hAx(2),[5.4 6.2])
